package development.app;

import state.GameForm;
import state.util.array.StringArray;
import development.Global;
import development.group.FrmGroup18Plus;
import development.group.FrmGroupBongDaXoSo;
import development.group.FrmGroupCuaHang18PlusNapXu;
import development.group.FrmGroupKetBanMangXHChat;
import development.group.FrmGroupMenu;
import development.group.FrmGroupNapXuAndExchangeGold;
import development.group.FrmGroupThoiTietTinTuc;

public final class AppBussiness {
  public static GameForm getAppForm(String appId) {
    if ("napxu".equals(appId)) {
      FrmGroupNapXuAndExchangeGold.backForm = FrmGroupMenu.instance();
      return FrmGroupNapXuAndExchangeGold.instance();
    }
    
    if (Global.appClient == null || !Global.appClient.isConnectSuccess) {
      Global.alert.alert1(StringArray.create1("Không có kết nối đến", "máy chủ ứng dụng"));
      return null;
    }
    
    if ("chat".equals(appId)) {
      FrmGroupKetBanMangXHChat.tabIndex = 2;
      return FrmGroupKetBanMangXHChat.instance();
    }
    if ("xoso".equals(appId)) {
      FrmGroupBongDaXoSo.tabIndex = 0;
      return FrmGroupBongDaXoSo.instance();
    }
    if ("bongda".equals(appId)) {
      FrmGroupBongDaXoSo.tabIndex = 1;
      return FrmGroupBongDaXoSo.instance();
    }
    if ("thoitiet".equals(appId)) {
      FrmGroupThoiTietTinTuc.tabIndex = 0;
      return FrmGroupThoiTietTinTuc.instance();
    }
    if ("ketban".equals(appId)) {
      FrmGroupKetBanMangXHChat.tabIndex = 0;
      return FrmGroupKetBanMangXHChat.instance();
    }
    if ("18+".equals(appId)) {
      return FrmGroup18Plus.instance();
    }
    if ("cuahang".equals(appId)) {
      return FrmGroupCuaHang18PlusNapXu.instance();
    }
    if ("tintuc".equals(appId)) {
      FrmGroupThoiTietTinTuc.tabIndex = 1;
      return FrmGroupThoiTietTinTuc.instance();
    }
    if ("mangxh".equals(appId)) {
      FrmGroupKetBanMangXHChat.tabIndex = 1;
      return FrmGroupKetBanMangXHChat.instance();
    }
    if("sukienhot".equals(appId)){
      FrmGroupThoiTietTinTuc.tabIndex = 2;
      return FrmGroupThoiTietTinTuc.instance();
    }
    return null;
  }
}
